package com.mrd.gtimpframe.quartz.job;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mrd.gtimpframe.singlewindow.SingleWindow;

/**
 * 将报关资料通过ftp传到对应客户端文件夹下
 */
@Component
public class Upload2SWClient {
  @Autowired
  private SingleWindow singleWindow;

  public void execute() {
    boolean uploading = false;
    for (Thread thread : SingleWindow.uploadThread.values()) {
      if (thread.isAlive()) {
        uploading = true;
        break;
      }
    }
    if (!uploading) {
      singleWindow.uploadToSWClient();
    }
  }
}
